<script>
    $(function() {
        var icons = {
            header: "ui-icon-circle-arrow-e",
            activeHeader: "ui-icon-circle-arrow-s"
        };
        $("#loai-don").accordion({
            icons: icons
        });
    });
</script>
<div id="dm-don">
    <h1 >Danh mục biểu mẫu</h1>
    <div id="loai-don">
        <h3 class="icdown">Đơn gửi trực tuyến</h3>

        <table id="tb-don">
            <?php
            if(is_array($dsbieumau)){
            foreach ($dsbieumau as $key => $value) {
                if ($value['Loai'] == 1) {
                    ?>
                    <tr id="row-don" >
                        <td id="col1">   <?php echo $value['TenBieuMau']; ?></td>
                        <td id="col2">    
                            <form action="<?php echo base_url(); ?>sinhvien/form_bieumau" method="POST">
                                <input type="hidden" name="LoaiDon" value="1" />
                                <button type="submit"
                                        class="bt-li-don" name="Ma_BieuMau" title="Tải đơn" value="<?php echo $value['Ma_BieuMau']; ?>" ></button>
                            </form>
                        </td>
                    </tr>
                    <?php
                }
            }}
            ?>

        </table>
        <h3 class="icdown">Đơn gửi trực tiếp</h3>
        <table id="tb-don">
            <?php
            if(is_array($dsbieumau)){
            foreach ($dsbieumau as $key => $value) {
                if ($value['Loai'] == 0) {
                    ?>
                    <tr id="row-don" >
                        <td id="col1">   <?php echo $value['TenBieuMau']; ?></td>
                        <td id="col2"> 
                            <form action="<?php echo base_url(); ?>sinhvien/form_bieumau" method="POST">
                                <input type="hidden" name="LoaiDon" value="0" />
                                <button type="submit"
                                        class="bt-li-don" name="Ma_BieuMau" title="Tải đơn" value="<?php echo $value['Ma_BieuMau']; ?>" ></button>
                            </form>
                        </td>
                    </tr>
                    <?php
                }
            }}
            ?>

        </table>



        <h3 class="icdown">Danh sách biểu mẫu</h3>

        <table id="tb-don">
            <?php
            if(is_array($dsbieumau)){
            foreach ($dsbieumau as $key => $value) {
                ?>
                <tr id="row-don" >
                    <td id="col1">   <?php echo $value['TenBieuMau']; ?></td>
                    <td id="col2"> 
                        <form action="<?php echo base_url(); ?>sinhvien/downloadDon" method="POST">
                            <button type="submit"
                                    class="bt-tai" name="Ma_BieuMau" title="Tải đơn" value="<?php echo $value['Ma_BieuMau']; ?>" ></button>
                        </form>
                    </td>
                </tr>
            <?php }}
            ?>

        </table>





    </div>

</div>

